/**
 * 微信API
 * Created by jiaaobo on 16/11/22.
 */

import  {HOST} from  "config";
import {Net} from "util";
import constant from "const";


export  default class WX_API {

  /**
   * 微信统一下单接口
   */
  static commitOrder(orderNo){
    // return Net.postCicadaJSON(window.HOST+"/wxPay/commitOrder.do",{},{orderNo : orderNo});
    return Net.postCicadaJSON(window.HOST+"/wxPay/test/commitOrder.do",{},{orderNo : orderNo});
  }

  /**
   * 获得身份token
   */
  static getAccessToken(){
    return Net.getJSON(window.HOST+"/wxAuth/getAccessToken.do",{});
  }


  /**
   * 获得jsticket
   */
  static getJSTicket(params){
    return Net.getJSON(window.HOST+"/wxAuth/getJSTicket.do?url="+params.currentUrl,{});
  }

  /**
   * 地理逆编码
   */
  static geocodeByRegeo(params){
    return Net.getJSON(window.HOST+"/location/getLocation.do?lat="+params.lat+"&lng="+params.lng,{});
  }


}






